package com.bdy.lm.taximanager.model;

import android.content.Context;
import android.content.SharedPreferences;

import com.bdy.lm.taximanager.app.MyApp;
import com.bdy.lm.taximanager.http.HttpJson;
import com.bdy.lm.taximanager.util.JsonUtils;

import org.apache.log4j.Logger;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by liming on 2017/3/23 0023.
 */

public class Fare {
    private String areaId;//运价执行行政区划代码
    private String fareType;//运价类型
    private String fareFrom;//运价有效期起
    private String fareDayDown;//昼间起步价(元)
    private String fareNightDown;//夜间起步价(元)
    private String fareWait;//候时单价(元/分钟)
    private String downDistance;//起步里程 (km)  XX.XX
    private String priceDay;//昼间单价(元/km)
    private String priceDayAdd;//昼间单程加价单价(元/km)
    private String priceNight;//夜间单价(元)
    private String priceNightAdd;//夜间单程加价单价(元/km)
    private String addKiloPerTrip;//单程加价公里 (km)
    private String nigthFrom = "23:00:00";//夜间时间起
    private String nightEnd = "5:00:00";//夜间时间止
    private String lowSpeedWait;//低速等候设置
    private String switchSpeed;//切换速度 (km/h)
    private String fareRemark;//运价备注说明
    private String fareStatusCode;//运价状态代码(0或1)
    private String fuelSurcharge;//燃油附加费(元)
    private String k;

    public Fare() {
    }

    public String getAreaId() {
        return areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    public String getFareType() {
        return fareType;
    }

    public void setFareType(String fareType) {
        this.fareType = fareType;
    }

    public String getFareFrom() {
        return fareFrom;
    }

    public void setFareFrom(String fareFrom) {
        this.fareFrom = fareFrom;
    }

    public String getFareDayDown() {
        return fareDayDown;
    }

    public void setFareDayDown(String fareDayDown) {
        this.fareDayDown = fareDayDown;
    }

    public String getFareNightDown() {
        return fareNightDown;
    }

    public void setFareNightDown(String fareNightDown) {
        this.fareNightDown = fareNightDown;
    }

    public String getFareWait() {
        return fareWait;
    }

    public void setFareWait(String fareWait) {
        this.fareWait = fareWait;
    }

    public String getDownDistance() {
        return downDistance;
    }

    public void setDownDistance(String downDistance) {
        this.downDistance = downDistance;
    }

    public String getPriceDay() {
        return priceDay;
    }

    public void setPriceDay(String priceDay) {
        this.priceDay = priceDay;
    }

    public String getPriceDayAdd() {
        return priceDayAdd;
    }

    public void setPriceDayAdd(String priceDayAdd) {
        this.priceDayAdd = priceDayAdd;
    }

    public String getPriceNight() {
        return priceNight;
    }

    public void setPriceNight(String priceNight) {
        this.priceNight = priceNight;
    }

    public String getPriceNightAdd() {
        return priceNightAdd;
    }

    public void setPriceNightAdd(String priceNightAdd) {
        this.priceNightAdd = priceNightAdd;
    }

    public String getAddKiloPerTrip() {
        return addKiloPerTrip;
    }

    public void setAddKiloPerTrip(String addKiloPerTrip) {
        this.addKiloPerTrip = addKiloPerTrip;
    }

    public String getNigthFrom() {
        return nigthFrom;
    }

    public void setNigthFrom(String nigthFrom) {
        this.nigthFrom = nigthFrom;
    }

    public String getNightEnd() {
        return nightEnd;
    }

    public void setNightEnd(String nightEnd) {
        this.nightEnd = nightEnd;
    }

    public String getLowSpeedWait() {
        return lowSpeedWait;
    }

    public void setLowSpeedWait(String lowSpeedWait) {
        this.lowSpeedWait = lowSpeedWait;
    }

    public String getSwitchSpeed() {
        return switchSpeed;
    }

    public void setSwitchSpeed(String switchSpeed) {
        this.switchSpeed = switchSpeed;
    }

    public String getFareRemark() {
        return fareRemark;
    }

    public void setFareRemark(String fareRemark) {
        this.fareRemark = fareRemark;
    }

    public String getFareStatusCode() {
        return fareStatusCode;
    }

    public void setFareStatusCode(String fareStatusCode) {
        this.fareStatusCode = fareStatusCode;
    }

    public String getFuelSurcharge() {
        return fuelSurcharge;
    }

    public void setFuelSurcharge(String fuelSurcharge) {
        this.fuelSurcharge = fuelSurcharge;
    }

    public String getK() {
        return k;
    }

    public void setK(String k) {
        this.k = k;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Fare fare = (Fare) o;

        if (!areaId.equals(fare.areaId)) return false;
        if (!fareType.equals(fare.fareType)) return false;
        if (!fareFrom.equals(fare.fareFrom)) return false;
        if (!fareDayDown.equals(fare.fareDayDown)) return false;
        if (!fareNightDown.equals(fare.fareNightDown)) return false;
        if (!fareWait.equals(fare.fareWait)) return false;
        if (!downDistance.equals(fare.downDistance)) return false;
        if (!priceDay.equals(fare.priceDay)) return false;
        if (!priceDayAdd.equals(fare.priceDayAdd)) return false;
        if (!priceNight.equals(fare.priceNight)) return false;
        if (!priceNightAdd.equals(fare.priceNightAdd)) return false;
        if (!addKiloPerTrip.equals(fare.addKiloPerTrip)) return false;
        if (!nigthFrom.equals(fare.nigthFrom)) return false;
        if (!nightEnd.equals(fare.nightEnd)) return false;
        if (!lowSpeedWait.equals(fare.lowSpeedWait)) return false;
        if (!switchSpeed.equals(fare.switchSpeed)) return false;
        if (!fareRemark.equals(fare.fareRemark)) return false;
        if (!fareStatusCode.equals(fare.fareStatusCode)) return false;
        if (!fuelSurcharge.equals(fare.fuelSurcharge)) return false;
        return k.equals(fare.k);

    }

    @Override
    public int hashCode() {
        int result = areaId.hashCode();
        result = 31 * result + fareType.hashCode();
        result = 31 * result + fareFrom.hashCode();
        result = 31 * result + fareDayDown.hashCode();
        result = 31 * result + fareNightDown.hashCode();
        result = 31 * result + fareWait.hashCode();
        result = 31 * result + downDistance.hashCode();
        result = 31 * result + priceDay.hashCode();
        result = 31 * result + priceDayAdd.hashCode();
        result = 31 * result + priceNight.hashCode();
        result = 31 * result + priceNightAdd.hashCode();
        result = 31 * result + addKiloPerTrip.hashCode();
        result = 31 * result + nigthFrom.hashCode();
        result = 31 * result + nightEnd.hashCode();
        result = 31 * result + lowSpeedWait.hashCode();
        result = 31 * result + switchSpeed.hashCode();
        result = 31 * result + fareRemark.hashCode();
        result = 31 * result + fareStatusCode.hashCode();
        result = 31 * result + fuelSurcharge.hashCode();
        result = 31 * result + k.hashCode();
        return result;
    }

    @Override
    public String toString() {
        return "Fare{" +
                "areaId='" + areaId + '\'' +
                ", fareType='" + fareType + '\'' +
                ", fareFrom='" + fareFrom + '\'' +
                ", fareDayDown='" + fareDayDown + '\'' +
                ", fareNightDown='" + fareNightDown + '\'' +
                ", fareWait='" + fareWait + '\'' +
                ", downDistance='" + downDistance + '\'' +
                ", priceDay='" + priceDay + '\'' +
                ", priceDayAdd='" + priceDayAdd + '\'' +
                ", priceNight='" + priceNight + '\'' +
                ", priceNightAdd='" + priceNightAdd + '\'' +
                ", addKiloPerTrip='" + addKiloPerTrip + '\'' +
                ", nigthFrom='" + nigthFrom + '\'' +
                ", nightEnd='" + nightEnd + '\'' +
                ", lowSpeedWait='" + lowSpeedWait + '\'' +
                ", switchSpeed='" + switchSpeed + '\'' +
                ", fareRemark='" + fareRemark + '\'' +
                ", fareStatusCode='" + fareStatusCode + '\'' +
                ", fuelSurcharge='" + fuelSurcharge + '\'' +
                ", k='" + k + '\'' +
                '}';
    }
}
